<script setup  lang="ts">
import { ref } from 'vue'
var ws = new WebSocket("ws://localhost:8181");
ws.onopen = function (e) {
   console.log('Connection to server opened');
}



let input = ref('')

let sendMessage = function sendMessage():void {
      ws.send(input.value);
    }
</script>

<template>
   <div>webSocket</div>
   <el-input v-model="input" placeholder="Please input" />
   <el-button @click="sendMessage">发送</el-button>
</template>
   
<style scoped>

</style>